/*
 * @Description: 
 * @Author: ZhangHan
 * @Date: 2025-05-10 17:07:23
 * @LastEditTime: 2025-05-10 17:24:06
 * @LastEditors: ZhangHan
 */
import Mock from "mockjs";

// 中国所有省份
const allProvinces = [
  "北京市", "天津市", "河北省", "山西省", "内蒙古自治区", 
  "辽宁省", "吉林省", "黑龙江省", "上海市", "江苏省", 
  "浙江省", "安徽省", "福建省", "江西省", "山东省", 
  "河南省", "湖北省", "湖南省", "广东省", "广西壮族自治区", 
  "海南省", "重庆市", "四川省", "贵州省", "云南省", 
  "西藏自治区", "陕西省", "甘肃省", "青海省", "宁夏回族自治区", 
  "新疆维吾尔自治区", "台湾省", "香港特别行政区", "澳门特别行政区"
];


const majorProvinces = {
  "北京市": ["东城区", "西城区", "朝阳区", "海淀区"],
  "上海市": ["黄浦区", "徐汇区", "长宁区", "静安区"],
  "广东省": ["广州市", "深圳市", "珠海市", "汕头市"],
  "江苏省": ["南京市", "苏州市", "无锡市", "常州市"]
};

const generateMixedCascaderData = () => {
  return Object.keys(majorProvinces).map(province => {
    const cities = majorProvinces[province];
    
    const cityOptions = cities.map(city => ({
      value: city,
      label: city,
      children: Array.from({length: 3}, (_, i) => ({
        value: `${city}第${i+1}区`,
        label: `${city}第${i+1}区`
      }))
    }));
    
    // 添加一些Mock生成的城市
    if (Math.random() > 0.5) {
      cityOptions.push({
        value: Mock.mock("@city"),
        label: Mock.mock("@city"),
        children: Array.from({length: 3}, () => ({
          value: Mock.mock("@county"),
          label: Mock.mock("@county")
        }))
      });
    }
    
    return {
      value: province,
      label: province,
      children: cityOptions
    };
  });
};

const cascaderOptions = generateMixedCascaderData();

export { cascaderOptions };